<?php
namespace app\open\controller;
use helper\Wechat as WechatHelper;
use think\Exception;
class Wechat extends Base
{
	public function getScheme()
	{
		$D=request()->get();
		if (request()->isPost())
			$D=request()->post();
		$path='';
		if (!empty($D['path']))
			$path=$D['path'];
		try {
			$scheme=WechatHelper::getMiniScheme($path);
			if (empty($scheme))
				return $this->ajaxReturn('获取失败',-100);
			return $this->ajaxReturn('',0,['scheme'=>$scheme]);
		} catch (Exception $e) {
			return $this->ajaxReturn($e->getLine().':'.$e->getMessage(),-100);
		}
	}
}